import { Controller, Get, Post, Body, Query } from '@nestjs/common';
import { AccountService } from './account.service';
import { CreateDto } from './dto/create.dto'
import { GetAccountsDto } from './dto/get-account.dto'
import { RemoveDto } from './dto/remove.dto'
import { UpdateDto } from './dto/update.dto'

@Controller('accounts')
export class AccountController {
  constructor(private readonly accountService: AccountService) { }

  @Post("createAccount")
  async createAccount(@Body() createDto: CreateDto) {
    return this.accountService.createAccount(createDto);
  }

  @Get("getAccountsByUserId")
  async getAccountsByUserId(@Query() getAccountsDto: GetAccountsDto) {
    return this.accountService.getAccountsByUserId(getAccountsDto);
  }

  @Post("updateAccountByDataId")
  async updateAccountByDataId(@Body() updateDto: UpdateDto) {
    return this.accountService.updateAccountByDataId(updateDto);
  }

  @Post("removeAccountsByDataIds")
  async removeAccountsByDataIds(@Body() removeDto: RemoveDto) {
    return this.accountService.removeAccountsByDataIds(removeDto);
  }

}